//
//  HJAboutUsViewController.m
//  Sneakers
//
//  Created by 胡光健 on 2017/11/21.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HJAboutUsViewController.h"
#import "HJAboutUsCell.h"

@interface HJAboutUsViewController ()
@property(nonatomic,strong)NSArray * titleArray;
@property(nonatomic,strong)NSArray * contentArray;
@property(nonatomic,strong)UILabel * lab;
@end

@implementation HJAboutUsViewController
-(NSArray *)titleArray {
    if (!_titleArray) {
        _titleArray = @[@"版本号",@"客服热线",@"公司地址",@"官方网站",@""];
    }
    return _titleArray;
}
-(NSArray *)contentArray {
    if (!_contentArray) {
        _contentArray = @[[NSString stringWithFormat:@"V%@",[CommonTools appVersion]],@"400-XXXX-XXXX",@"杭州市江干区新加坡科技园16幢207-208室",@"www.sneakercn.com",@""];
    }
    return _contentArray;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self configBottomLabel];
    self.leftNavImageName = @"Fill 1";
}
-(void)didClickLeftNavAction {
    self.lab.hidden = YES;
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)configTableView {
    self.tableViewStyle = UITableViewStylePlain;
    [super configTableView];
    self.tableView.tableHeaderView = [[NSBundle mainBundle]loadNibNamed:@"header" owner:nil options:nil].firstObject;
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 4;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HJAboutUsCell * CELL =(HJAboutUsCell *)[tableView cellForRowAtIndexPath:indexPath];
    if (!CELL) {
        CELL = [[NSBundle mainBundle]loadNibNamed:@"HJAboutUsCell" owner:nil options:nil].lastObject;
    }
    CELL.selectionStyle = UITableViewCellSelectionStyleNone;
    CELL.title.text = self.titleArray[indexPath.row];
    CELL.content.text = self.contentArray[indexPath.row];
  
    return CELL;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (mScreenWidth==320) {
        return 50;
    }
    return 80;
}

-(void)configBottomLabel {
    CGFloat Y;
    if (mScreenHeight == 812) {
        Y = mScreenHeight - 51;
    }else {
        Y = mScreenHeight - 15-17;
    }
    self.lab = [self configWithLabel:@"锐新潮流(杭州)文化传播有限公司" textColor:[UIColor lightGrayColor] textAlignment:NSTextAlignmentCenter frame:CGRectMake(self.view.centerX-150,Y, 300, 20) font:HJFontSize(mScreenWidth/414 * 13)];
    [[UIApplication sharedApplication].keyWindow addSubview:self.lab];
}

-(void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
   self.lab.hidden = YES;
}
@end
